#define _CRT_SECURE_NO_WARNINGS   1

#include <iostream>
using namespace std;

int main()
{
	long long int n;
	cin >> n;
	long long int B, B_previous;
	long long int C, C_previous;
	long long int CONST = 1000000007;
	B = 1;
	C = 2;

	for (int i = 1; i <= n - 1; i++)
	{
		B_previous = B;
		C_previous = C;
		B = (2 * C_previous + 1) % CONST;
		C = (2 * C_previous + B_previous + 2) % CONST;
	}
	cout << B << " " << C;
	return 0;
}